package com.itheima.Demo;

import com.itheima.Utils.MybatisUtils;
import com.itheima.dao.OrderMapper;
import com.itheima.pojo.Order;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

//查询订单号为20140921001的订单的详情信息即查询订单信息+订单中的商品信息；

public class Demo01 {
    @Test
    public void demo01(){
        SqlSessionFactory sqlSessionFactory = MybatisUtils.getSqlSessionFactory();
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        OrderMapper mapper = sqlSession.getMapper(OrderMapper.class);
        Order order = mapper.findByNum("20140921001");
        System.out.println(order);
        sqlSession.close();
    }
}
